How to: Create an expression in a query.
Solution:
In the query design grid, use the expression builder in the 'Criteria' row.
Design grid
To type criteria for the query:
1) If the Database window is not active, activate the Database window.
2) If the query is not open, open the Query Design view.
3) In the design grid in the bottom half of the Query Design window, right-click in the 'Criteria' row for the desired field. (A menu appears.)
4) Select 'Build...'. (The Expression Builder dialog box appears.)
5) Select the object from which to use fields from the first list box. (A list of fields appears in the second list box.)
List of fields
NOTE: If a '+' appears on the folder for an object, click on the plus to view the objects below the specific type of object.
6) Select a field from the second list box.
7) Click 'Paste'. (The selected field appears in the expression box at the top of the dialog box.)
Expression box
8) Click the button for the desired calculation. (The symbol appears next in the expression box at the top of the dialog box.)
Expression box
9) Select the second field to include in the expression.
Select field
10) Click 'Paste'. (The selected field appears after the symbol in the expression box at the top of the dialog box.)
11) Repeat steps 5) or 6) through 10) until the expression is completed.
NOTE 1: Fields from various tables can be used together for the expression.
NOTE 2: Click 'Undo' to undo the last action (i.e., the last field or symbol added to the expression box).
12) When the expression is complete, click the 'OK' button. (The expression appears in the Criteria row of the query design grid.)
Criteria row
NOTE: Click 'Cancel' to cancel the entire expression.
13) Repeat steps 3) through 12) in the 'or' row, to create another criteria.
NOTE: 'Or' means that one or the other of the defined criteria have to be true.
14) Repeat step 13) for each criteria to add for THAT field.
15) Repeat steps 3) through 14) for each field for which to type criteria.
16) Select the 'File' menu and select 'Save' to save the expression entries.
17) Select the 'File' menu and select 'Close' to close the Query Design view.